package org.qs.webservice.dao.content;



import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.qs.webservice.domain.ConChapter;
import org.springframework.stereotype.Component;

@Component
public interface ConChapterMapper {
	
	/**
	 * 获取章节列表
	 * @param book_id
	 * @param pages
	 * @param contents
	 * @param orderType
	 * @return
	 */
	List<ConChapter> getChapterListWithoutContent(@Param("book_id")int book_id,@Param("pages")int pages,
			@Param("contents")int contents,@Param("orderType")String orderType,@Param("date")Date date,
			@Param("user_id")String user_id);
	/**
	 * 分卷获取全部章节
	 * @param book_id
	 * @param pages
	 * @param contents
	 * @param orderType
	 * @param date
	 * @return
	 */
	List<ConChapter> getChaptersWithoutContent(@Param("book_id")int book_id,
			@Param("orderType")String orderType,@Param("date")Date date,@Param("user_id")String user_id);
	/**
	 * 获取章节列表
	 * @param book_id
	 * @param date
	 * @return
	 */
	int getChaptersCountWithoutContent(@Param("book_id")int book_id,@Param("date")Date date);
	/**
	 * 获取上一章节id
	 * @param book_id
	 * @param preRemark
	 * @return
	 */
	List<ConChapter> getBookChaptersByBookidAndPreRemark(@Param("book_id")int book_id,@Param("preRemark")int preRemark,@Param("vol_id")int vol_id);
	/**
	 * 获取下一章节id
	 * @param book_id
	 * @param preRemark
	 * @return
	 */
	List<ConChapter> getBookChaptersByBookidAndNextRemark(@Param("book_id")int book_id,@Param("preRemark")int preRemark,@Param("date")Date date,@Param("vol_id")int vol_id);
	/**
	 * 根据章节id获取详情
	 * @param chapter_id
	 * @return
	 */
	ConChapter getChapterInfoById(@Param("chapter_id")int chapter_id,@Param("date")Date date);
	/**
	 * 根据章节id获取图书详情
	 * @param book_id
	 * @param chapter_id
	 * @param date
	 * @return
	 */
	ConChapter getChapterAndBookInfoById(@Param("chapter_id")int chapter_id,@Param("date")Date date);
	/**
	 * 获取正文
	 * @param chapter_id
	 * @return
	 */
	ConChapter getChapterContentById(@Param("chapter_id")int chapter_id);
}